"LOL LOCK.txt"

def LockComputer():
    os.system("rundll32.exe user32.dll, LockWorkStation")

http://vlaurie.com/computers2/Articles/rundll32.htm
http://support.microsoft.com/kb/164787

===============================================================

#!/usr/bin/env python
#Created By Ricky saltzer
#----------------------------
import pyHook, pythoncom, os, random, time
from VideoCapture import Device

#-------------
# Settings
#-------------
snapshot = "C:\\snap\\"     # Snapshot Directory, Use Two Backslashes for Paths
count = 5 # Define Startup Time

#------------
# Splash
#------------
print("LOL LOCK")
print("Version .01")
print("Created By: Ricky Saltzer")
print("-"*25)

#-----------------
# Webcam Capture
#-----------------
def TakePicture():
    cam = Device()
    location = "%s%s.jpg" % (snapshot, str(random.randint(1,1000)))
    print(location)
    cam.saveSnapshot(location)
    return location

#----------------
# Lock Computer
#----------------
def LockComputer():
    os.system("rundll32.exe user32.dll, LockWorkStation")


#----------------------
# Load Snapshot Folder
#----------------------
def ViewSnapshots():
    command = "explorer.exe %s" % snapshot
    os.system(command)


#-------------------
# Mouse Move Event
#-------------------

def onclick(event):
    LockComputer()  # Lock System
    location = TakePicture()   # Take Picture of Victim and get Location
    ViewSnapshots() # Load Snapshot
    exit()

#-------------------
# Keydown Event
#-------------------

def exitkey(event):
    if event.KeyID == 164:
        exit()


#----------------------
# Count for 5 Seconds
#----------------------
pause = True
ti = count
while pause:
    print("Starting in %d") % ti
    ti = ti -1
    time.sleep(1)

    if ti == 0:
        pause = False

print("Hook Inserted...")

#------------------------------
# Mouse / Keyboard Hook Loop
#------------------------------

hm = pyHook.HookManager()
hm.SubscribeMouseAllButtonsDown(onclick)
km = pyHook.HookManager()
km.KeyDown = exitkey
km.HookKeyboard()
hm.HookMouse()
pythoncom.PumpMessages()
hm.UnhookMouse()


==========================================================================================

[Used in ooRexxshell]

Determine if an Application is Console or GUI
http://www.codeguru.com/cpp/w-p/system/misc/article.php/c2897/

HOWTO: How To Determine Whether an Application is Console or GUI
http://support.microsoft.com/?scid=kb%3Ben-us%3B90493&x=13&y=16

http://www.mail-archive.com/cygwin@cygwin.com/msg41116.html
chercher is_gui

http://stackoverflow.com/questions/878598/how-to-detect-net-application-type


Remember :
D:\local\ReactOs\svn\trunk\reactos\dll\ntdll\ldr\utils.c

GetBinaryType
http://msdn.microsoft.com/en-us/library/aa364819(VS.85).aspx
As an alternative, you can obtain the same information by calling the SHGetFileInfo function, passing the SHGFI_EXETYPE flag in the uFlags parameter.
BOOL WINAPI GetBinaryType(
  __in   LPCTSTR lpApplicationName,
  __out  LPDWORD lpBinaryType
);
SCS_32BIT_BINARY    0   A 32-bit Windows-based application
SCS_64BIT_BINARY    6   A 64-bit Windows-based application.
SCS_DOS_BINARY      1   An MS-DOS ÔøΩ based application
SCS_OS216_BINARY    5   A 16-bit OS/2-based application
SCS_PIF_BINARY      3   A PIF file that executes an MS-DOS ÔøΩ based application
SCS_POSIX_BINARY    4   A POSIX ÔøΩ based application
SCS_WOW_BINARY      2   A 16-bit Windows-based application


SearchPath


Order of precedence in locating executable files is .com, .exe and .bat
http://support.microsoft.com/?scid=kb%3Ben-us%3B35284&x=11&y=14
usual order of precedence is used (.COM, .EXE, and .BAT).


http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.tools/2006-12/msg00011.html
    Yes, just as MSDN for GetBinaryType documented, GetBinaryType API only
    deals with Exe file, not for DLL files. I also see an internal record
    regarding this issue, and the GetBinaryType API owner confirmed this design
    point.

    If you really wanted to distinguish between Exe and DLL, there is no win32
    API for it. The only way is dealing with their PE format(yes, Exe and DLL
    both use the same PE format). For example, you may check
    IMAGE_FILE_HEADER.Characteristics field of the PE file, just check
    IMAGE_FILE_EXECUTABLE_IMAGE and IMAGE_FILE_DLL flags. "Matt Pietrek" has
    written a wonderful article regarding PE format:
    "An In-Depth Look into the Win32 Portable Executable File Format"
    http://msdn.microsoft.com/msdnmag/issues/02/02/PE/

    To distinguish between 16 and 32 bit Exe/DLL file, you should check
    "NE"(16bit) or "PE"(32bit) signature in the file header, please see the
    article below for more information:
    "How to detect the types of executable files"
    http://www.delphidabbler.com/articles?article=8

    To distinguish between 32bit and 64 bit PE file, you should check
    IMAGE_FILE_HEADER.Machine field. Based on the Microsoft PE and COFF
    Specification below, I have listed out all the possible values for this
    field:
    http://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac
    8184a/pecoff_v8.doc

    IMAGE_FILE_MACHINE_UNKNOWN 0x0 The contents of this field are assumed to be
    applicable to any machine type
    IMAGE_FILE_MACHINE_AM33 0x1d3 Matsushita AM33
    IMAGE_FILE_MACHINE_AMD64 0x8664 x64
    IMAGE_FILE_MACHINE_ARM 0x1c0 ARM little endian
    IMAGE_FILE_MACHINE_EBC 0xebc EFI byte code
    IMAGE_FILE_MACHINE_I386 0x14c Intel 386 or later processors and compatible
    processors
    IMAGE_FILE_MACHINE_IA64 0x200 Intel Itanium processor family
    IMAGE_FILE_MACHINE_M32R 0x9041 Mitsubishi M32R little endian
    IMAGE_FILE_MACHINE_MIPS16 0x266 MIPS16
    IMAGE_FILE_MACHINE_MIPSFPU 0x366 MIPS with FPU
    IMAGE_FILE_MACHINE_MIPSFPU16 0x466 MIPS16 with FPU
    IMAGE_FILE_MACHINE_POWERPC 0x1f0 Power PC little endian
    IMAGE_FILE_MACHINE_POWERPCFP 0x1f1 Power PC with floating point support
    IMAGE_FILE_MACHINE_R4000 0x166 MIPS little endian
    IMAGE_FILE_MACHINE_SH3 0x1a2 Hitachi SH3
    IMAGE_FILE_MACHINE_SH3DSP 0x1a3 Hitachi SH3 DSP
    IMAGE_FILE_MACHINE_SH4 0x1a6 Hitachi SH4
    IMAGE_FILE_MACHINE_SH5 0x1a8 Hitachi SH5
    IMAGE_FILE_MACHINE_THUMB 0x1c2 Thumb
    IMAGE_FILE_MACHINE_WCEMIPSV2 0x169 MIPS little-endian WCE v2

    Yes, you may check IMAGE_FILE_MACHINE_AMD64|IMAGE_FILE_MACHINE_IA64 for
    64bit and IMAGE_FILE_MACHINE_I386 for 32bit.

    Finally, many existing Exe/DLL tools also parses the PE file format
    internally, such as dumpbin.exe etc...

==========================================================================================
sysfiletree & FindFirstFile

http://blogs.msdn.com/oldnewthing/archive/2005/07/20/440918.aspx
http://netez.com/2xExplorer/shellFAQ/bas_xplore.html

